Files containing unexpected data may cause instability in a client application during “file open” operations. Some applications include measures to address this potential problem including cancellable “file open”, document recovery, or up-front validation. Other applications may include a per-datum validation system that checks individual pieces of data as they are loaded into memory, allowing the “file open” operation to end prematurely if any portion of the data is deemed invalid.
These approaches are, however, unable to overcome two significant problems. Firstly, at the time of discovery of an error, an unknown percentage of the file may already be loaded into memory. The application may be prone to crash as it tries to back away from a partially loaded file. Furthermore, abandoning the “file open” operation itself may present security concerns as the application cleans up incomplete data.
Moreover, the above described approaches typically validate only a single piece of data against known good values. Thus, they may lack the ability to consider data semantics. For example, a conventional system may be able to guarantee that value A falls in the range of 1 to 10, but may not be able to guarantee that value B is less than value A, or if value A is 4, value B must also be 4, etc. Validating these relationships between discreet pieces of data may enhance the ability of a data validation system to determine whether a file is well-formed.